<?php
  header('Content-Type:text/html;charset=utf-8');
  require_once 'class.php';
  PDOc::_connect();
  session_start();
  $adminRank=$_SESSION['adminRank'];
  if ($adminRank==1) {
  	PDOc::showAllUsers();
  	PDOc::Button('userIndex.php','返回个人主页');
  } else {
  	if ($adminRank==2) {
  		echo PDOc::super_showAllUsers();
      echo '<br/>';
      echo '将id为<form action="actionSetAdmin.php" method="post"><input type="text" name="id">的用户设置成管理员<input type="submit" value="确认"></form><br/>';
      echo '将id为<form action="actionSetNormalUser.php" method="post"><input type="text" name="id">的用户设置成普通用户<input type="submit" value="确认"></form><br/>';
  		PDOc::Button('userIndex.php','返回个人主页');
  	} else {
  		echo '你无权访问此页面！<br/>';
  		PDOc::Button('userIndex.php','返回个人主页');
  	}
  }
?>
<HTML>
<HEAD><TITLE>用户列表</TITLE></HEAD>
</HTML>